//
//  ZYXDownSuccessVC.m
//  RuiBeiKang
//
//  Created by iOS开发1 on 2019/1/9.
//  Copyright © 2019年 JW. All rights reserved.
//

#import "ZYXDownSuccessVC.h"
#import "ZYXClassNameVC.h"

@interface ZYXDownSuccessVC ()
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;

@end

@implementation ZYXDownSuccessVC

- (void)viewDidLoad {
    [super viewDidLoad];
      self.view.backgroundColor = [UIColor whiteColor];
    if ([self.typeStr isEqualToString:@"down"]) {
        self.title = @"添加下载";
        self.imgView.image = [UIImage imageNamed:@"downSuccess"];
        self.titleLabel.text = @"添加下载成功";
        self.contentLabel.text = @"可到视频下载列表查看";
    }else if ([self.typeStr isEqualToString:@"class"]) {
        self.title = @"购买课程";
        self.imgView.image = [UIImage imageNamed:@"classSuccess"];
        self.titleLabel.text = @"您的课程购买成功";
        self.contentLabel.text = @"可到购买记录查看详情";
    }else{
        self.title = @"会员充值";
        self.imgView.image = [UIImage imageNamed:@"vipSuccess"];
        self.titleLabel.text = @"充值成功";
        self.contentLabel.text = @"可到购买记录查看详情";
    }
    
    
  
}
- (IBAction)clickCheakBtn:(UIButton *)sender {
    if ([self.typeStr isEqualToString:@"down"]) {
     
         [[NSNotificationCenter defaultCenter] postNotificationName:@"qwertyuiop" object:nil];
        self.tabBarController.selectedIndex = 2;
        [self.navigationController popToRootViewControllerAnimated:YES];
        
    }else if ([self.typeStr isEqualToString:@"class"]) {
    
        // 返回到任意界面
//        for (UIViewController *temp in self.navigationController.viewControllers) {
//            if ([temp isKindOfClass:[ZYXClassNameVC class]]) {
//                [self.navigationController popToViewController:temp animated:YES];
//            }
//        }

        NSInteger index=[[self.navigationController viewControllers]indexOfObject:self];
        [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:index-2]animated:YES];
        
  
    }else{
         [self.navigationController popToRootViewControllerAnimated:YES];
        [[NSNotificationCenter defaultCenter] postNotificationName:@"1111111" object:nil];
       
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
